<?php

require_once dirname(dirname(__FILE__)).'/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    // My production server only accepts an "html" diresctory
    sfConfig::set('sf_web_dir', str_replace('/web', '/html', sfConfig::get('sf_web_dir')));
    sfConfig::set('sf_upload_dir', sfConfig::get('sf_web_dir').'/uploads');

    // Plugins
    $this->enablePlugins(array(
      'sfDoctrinePlugin',
      'sfDoctrineGuardPlugin',
      'csDoctrineActAsSortablePlugin',
      'sfGoogleAnalyticsPlugin',
    ));
  }

  /**
   * Config Doctrine
   *
   * @return void
   * @author Éric Rogé
   **/
  public function configureDoctrine(Doctrine_Manager $manager)
  {
    $manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_ALL);

    // Activate the APC query cache
    if (function_exists('apc_store') && ini_get('apc.enabled'))
    {
     $manager->setAttribute(Doctrine::ATTR_QUERY_CACHE, new Doctrine_Cache_Apc());
    }
  }
}
